import request from "../utils/request";

export default {
    // 登录验证
    login(username, password) {
        return request({
            url: "/user/admin/admin_login",
            method: "post",
            data: {
                username,
                password,
            },
        });
    },
    // 登录的用户数以及注册用户数
    UserNum() {
        return request({
            url: "/equipment/admin/user_num",
            method: "get",
        });
    },
    // 获取指定的设备信息
    queryByCondition(data) {
        return request({
            url: `/equipment/queryByCondition`,
            method: "post",
            data: data
        });
    },
    // 修改设备
    update_equipment(val){
        return request({
            url: '/equipment/updateEquipmentInfo',
            method: "put",
            data: val
        });
    },
    // 删除设备
    delete_equipment(val){
        return request({
            url: '/equipment/deleteEquimentInfo',
            method: "delete",
            data: val
        });
    },
    // 批量或者单个修改状态
    changeStatus(val) {
        return request({
            url: `/user/user/change_status/${user_id}/${status}`,
            method: "put",
        });
    },
    // 删除账号
    deleteUser(user_id) {
        return request({
            url: `/user/user/delete_account/${user_id}`,
            method: "delete",
        });
    },
	// 修改密码
	modifyPwassord(adminId, password) {
		return request({
			url: `/user/admin/modify_password/${adminId}`,
			method: "put",
			data: {
				password,
			},
		});
	},
	// 创建设备
	create_equipment(val) {
		return request({
			url: '/equipment/insertEquipmentInfo',
			method: "post",
			data: val
		});
	},
    // 下载Excel
    downLoadExcel() {
        return request({
            responseType: "blob",
			method: "post",
            url: '/equipment/downloadEquipmentInfoExcel',
        })
    },
    // 上传图片
    uploadeqIM(val){
        return request({
            method: "post",
            url: '/equipmentimg/insertimg',
            data: val
        })
    }
};


